!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7805d109-b27e-4ed0-85be-50193d0d344d",e._sentryDebugIdIdentifier="sentry-dbid-7805d109-b27e-4ed0-85be-50193d0d344d")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7976],{7976:(e,t,l)=>{l.d(t,{R:()=>A,n:()=>T});var a=l(37876),s=l(14232),o=l(26630),i=l(48762),r=l(33896),n=l(62250),d=l(38294),c=l(35891),u=l(70654),m=l(15023),p=l(14910);let h=({cssProps:e})=>{var t;let l,s=(0,p.Eb)(),{tTravel:r}=(0,m.Ml)(),n=(0,c.kc)();if(!s?.plan)return(0,a.jsx)(a.Fragment,{});let h=s.room.roomRate?.cancellationOptions.filter(e=>e.eligiblePlans[0]===s.plan.id)[0],x=s.room.roomRate?.mealTypeOptions.filter(e=>e.eligiblePlans[0]===s.plan.id)[0],b=(0,i.up)(n,s.plan.pricing.netPrice,i.Ex.WithCents),v=(0,i.up)(n,s.plan.pricing.netPrice,i.Ex.WithCents),g=(0,i.up)(n,{amount:s.plan.pricing.netPrice.amount+s.plan.pricing.excludedPrice.amount,currency:s.plan.pricing.netPrice.currency},i.Ex.WithCents);return(0,a.jsxs)("div",{className:e,children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 pb-4",children:[(0,a.jsx)("p",{className:`${i.cI}`,children:s.room.room.title}),(0,a.jsx)("div",{className:"flex flex-col gap-1",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[s.room.room.photos.length>0&&(0,a.jsx)(d.A,{image:s.room.room.photos[0],size:{default:5},style:{height:50,width:50,objectFit:"cover",position:"relative",borderRadius:4}}),(0,a.jsxs)("div",{children:[(0,a.jsx)(u.ef,{beds:s.room.room.beds}),(0,a.jsx)("p",{className:i.xT,children:h?.optionTitle}),(0,a.jsx)("p",{className:i.xT,children:x?.optionTitle})]})]})})]}),(0,a.jsx)("hr",{className:(0,o.xW)(i.yF,"-mx-8")}),(0,a.jsxs)("div",{className:"grid gap-6 py-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("p",{className:i.fJ,children:(t=s.plan.perRoomPricing.netPrice.amount,l=s.plan.pricing.netPrice.amount/t,`${l.toFixed(0)} ${l>1?"rooms":"room"}`)}),(0,a.jsx)("p",{className:i.xT,children:b})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("p",{className:i.fJ,children:r("priceBreakdownTaxesAndFees")}),(0,a.jsx)("p",{className:i.xT,children:v})]})]}),(0,a.jsx)("hr",{className:i.yF}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-4",children:[(0,a.jsx)("p",{className:i.$D,children:r("priceBreakdownTotal")}),(0,a.jsx)("p",{className:i.bx,children:g})]})]})};var x=l(13363),b=l(3006),v=l(12404),g=l(16625),y=l(29755),C=l(89099),j=l(81632),f=l(51991),P=l(19028),w=l(3892),I=l(21458);let N=e=>{let{open:t,onClose:l,hotelListing:s,initialSearchRequest:d,useGeoSubdomainSearch:c=!1,searchPlacement:u}=e,N=(0,C.useRouter)(),{tHotels:D}=(0,b.zg)(),{tTravel:A}=(0,m.Ml)(),{analyticsContext:T}=(0,P.pn)(),k=(0,w.l$)(),R=(0,j.V3)(),S=(0,p.Wq)(),H=(0,p.CT)(),M=(0,j.Tj)(),V=s||M.hotelData,[E,$]=(0,o.ID)(d?.guests||H),[_,L]=(0,g.x)((0,y.dt)(d?.dates||S)),O=(0,m.iH)((0,y.Ej)(_),S)&&(0,m.S2)(E,H),q=f.uC.noHotelSearch?v.Il.HotelCheckoutCheckAvailability:v.Il.HotelListingCheckAvailability;return(0,o.uV)(()=>{L((0,y.dt)(d?.dates||S))},[S]),(0,o.uV)(()=>{$(d?.guests||H)},[H]),(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(x.j,{open:t,doNotChangeHistory:!0,onClose:()=>{let e=T?.attribution?.source==="GoogleAds";if(f.uC.noHotelSearch&&e){let e=(0,y.Ej)(_);e&&(0,m.J$)(N,v.Il.DismissAvailability,{dates:e,guests:E,destinationId:V?{id:V.id,destinationType:v.C8.Hotel}:void 0},{scrollToTop:!1},k)}l()},modalName:"availability",className:"h-max m-auto max-h-[calc(100%_-_2_*_1.5rem)] max-w-[450px] w-[95%] md:max-w-[550px]",headerClassName:"grid grid-cols-[1fr,auto] gap-4 items-center",headerComponent:(0,a.jsx)("p",{className:`${i.cI} text-center pl-9`,children:D("chooseDatesToViewPrices")}),children:(0,a.jsxs)("form",{onSubmit:e=>{e?.preventDefault();let t=(0,y.Ej)(_);t&&((0,I.Y)(),l(),c&&V?(0,m.J$)(N,u||v.Il.TopHotelsCardSeePrices,{query:V.title,dates:t,guests:E,destinationId:{id:V.id,destinationType:v.C8.Hotel}},{scrollToTop:!1},k):(0,m.J$)(N,q,{dates:t,guests:E,destinationId:V?{id:V.id,destinationType:v.C8.Hotel}:void 0},{scrollToTop:!1},k))},className:"pt-[72px] pb-[88px] overflow-auto",children:[(0,a.jsx)("div",{className:"h-full",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2",children:[(0,a.jsx)(r.A,{searchDate:_,handleSearchDate:e=>{L(e)},numberOfMonths:2,buttonLabel:A("saveActionLabel"),calendarAvailability:R}),(0,a.jsx)(n.A,{searchGuests:E,initialValue:E,onDetailsChange:e=>{$(e)},buttonLabel:A("saveActionLabel")})]})}),O&&(0,a.jsx)(h,{cssProps:"px-8 pb-6"}),(0,a.jsx)("div",{className:"flex items-center fixed bottom-0 left-0 right-0 z-[10] bg-white gap-4 p-4 border-t border-t-secondaryGrey rounded-bl-[10px] rounded-br-[10px]",children:(0,a.jsx)(i.sP,{type:"submit",className:"w-full",children:D("checkAvailability")})})]})})})},D=(0,s.createContext)(null),A=({children:e,hotelData:t,initialOpen:l,initialSearchRequest:i,useGeoSubdomainSearch:r=!1,searchPlacement:n})=>{let[d,c]=(0,o.ID)(!1),[u,m]=(0,o.ID)(n),p=(0,s.useCallback)(e=>{m(e?.searchPlacement||n),c(!0)},[n,m,c]),h=(0,s.useCallback)(()=>{c(!1),m(n)},[n,m,c]);(0,o.uV)(()=>{l&&f.uC.autoAvailabilityModal&&p()},[l,p]);let x=(0,s.useMemo)(()=>({isOpen:d,open:p,close:h}),[h,d,p]);return(0,a.jsxs)(D.Provider,{value:x,children:[e,d&&(0,a.jsx)(N,{open:d,onClose:h,hotelListing:t,initialSearchRequest:i,useGeoSubdomainSearch:r,searchPlacement:u})]})},T=()=>{let e=(0,s.useContext)(D);return e||console.error("useModalChooseDates must be used within a ModalChooseDatesProvider"),e}},14910:(e,t,l)=>{l.d(t,{Ay:()=>I,Wq:()=>j,CT:()=>w,W0:()=>C,GE:()=>f,Eb:()=>P});var a=l(37876),s=l(14232),o=l(89099),i=l(26630),r=l(12404),n=l(70654),d=l(15023),c=l(47484),u=l(60807),m=l(29755),p=l(64651),h=l(81632),x=l(51991),b=l(44846),v=l(3892),g=l(21458);let y=(0,s.createContext)(null),C=()=>{let e=(0,s.useContext)(y);return e?{dates:e.dates,guests:e.guests,roomPlan:e.roomId&&e.planRateCode?{roomId:e.roomId,rateCode:e.planRateCode}:void 0}:null},j=()=>{let e=(0,s.useContext)(y);return e?e.dates:(0,m.vw)()},f=()=>{let{tHotels:e}=(0,n.zg)(),t=(0,s.useContext)(y),l=(0,o.useRouter)(),a=j(),i=w(),c=(0,v.l$)();if(!t)return{performAction:()=>{},comparePrices:()=>{},selectRoomPlan:()=>{},handleNextAction:()=>{},cartActionButton:e("checkAvailability")};let m=(e,a,s,o)=>{(0,g.Y)(),(0,u.J$)(l,e,{guests:s,dates:a,destinationId:{id:t.hotelData.id,destinationType:r.C8.Hotel},roomPlan:o},{scrollToTop:!1},c)};return{performAction:(e,l)=>{t.availabilityMode?t.selectedPlan&&(0,d.iH)(a,e)&&(0,d.S2)(i,l)?m(r.Il.RoomBook,e,l,{roomId:t.selectedPlan.room.room.id,rateCode:t.selectedPlan.plan.rateCode}):m(r.Il.HotelListingUpdateDates,e,l):m(x.uC.noHotelSearch?r.Il.HotelCheckoutCheckAvailability:r.Il.HotelListingCheckAvailability,e,l)},comparePrices:(e,t)=>{m(r.Il.RoomComparePrice,a,i,{roomId:e.room.id,rateCode:t.rateCode})},selectRoomPlan:(e,l)=>{t.setSelectedPlan({room:e,plan:l})},handleNextAction:m,cartActionButton:t.availabilityMode&&t.selectedPlan?"Reserve":e("checkAvailability"),customReserveAction:t.customReserveAction}},P=()=>{let e=(0,s.useContext)(y);return e?.availabilityMode&&e.selectedPlan||null},w=()=>{let e=(0,s.useContext)(y);return e?e.guests:d.tv},I=({children:e,availabilityRequest:t,initialSearchRequest:l,hotelData:o,customReserveAction:r})=>{let n,u,x,v,g,C=(0,i.q2)(c.yt),[j,f]=(0,s.useState)(null),[P,w]=(0,s.useState)(t?t.searchRequest:l||(0,c.Mc)(C)),[I,N]=(0,s.useState)(void 0),{getStoredSearchRequest:D}=(0,b.I)(),A=(n=(0,h.V3)(),g=(v=(x=(u=(()=>{if(!n?.days||n.days.length<=1)return null;let e=new p.YG,t=new p.YG().add(3,"months"),l=n.days.slice(1).filter(l=>{let a=(0,m.Aw)(l.date);return a.toDays()>=e.toDays()&&a.toDays()<=t.toDays()});return 0===l.length?null:l.reduce((e,t)=>t.price.amount{t||f(D())},[]),(0,i.uV)(()=>{let e=(0,c.Mc)(C);console.log("Request",e),w(e),N(void 0)},[C]);let T={dates:P?.dates||A?.lowestPriceDate||j?.dates||(0,m.vw)(),guests:P?.guests||j?.guests||d.tv,availabilityMode:!!t,roomId:P.roomPlan?.roomId,planRateCode:P.roomPlan?.rateCode,selectedPlan:I,setSelectedPlan:N,hotelData:o,customReserveAction:r};return(0,a.jsx)(y.Provider,{value:T,children:e})}},21458:(e,t,l)=>{l.d(t,{A:()=>d,Y:()=>n});var a=l(26630),s=l(3892),o=l(51991);let i="dateModalLastOpened",r=!!o.uC.dateModalThrottleOnSearch,n=()=>{r&&(0,a.kx)(i,Date.now())},d=(e=!0)=>{let[t,l]=(0,a.ID)(!1),o=(0,s.l$)()?.allowBackButton,n=(0,s.ht)()?.disableAuthSession;return(0,a.uV)(()=>{if(!e||n||!r&&!o)return void l(!1);let t=(0,a.RO)(i),s=Date.now();!t||s-t>1728e5?(l(!0),r||(0,a.kx)(i,s)):l(!1)},[o,n,e]),t}},81632:(e,t,l)=>{l.d(t,{ig:()=>h,V3:()=>x,Tj:()=>p});var a=l(37876),s=l(14232),o=l(12404),i=l(26630),r=l(33008),n=l(4365);let d="hotel-calendar-availability";var c=l(6408),u=l(3892);let m=(0,s.createContext)({}),p=()=>(0,s.useContext)(m),h=e=>{let{isNeedToFetchCalendar:t=!0}=e,[l,p]=(0,i.ID)(null),h=(0,u.ht)(),x=t&&!h?.disableCalendarAvailability,[b,v]=(0,s.useState)(null),{data:g}=(e=>{let[t,l]=(0,i.ID)(null),{currency:a}=(0,n.H2)();return(0,i.uV)(()=>{if(!e)return;let t=async()=>{let t=await (0,r.YS)(e),s={data:t,timestamp:Date.now(),currency:a};(0,i.kx)(d,s),l(t)},s=(0,i.RO)(d),n=!s||Date.now()-s.timestamp>432e5,c=s?.data?.hotelId!==e,u=s?.currency!==a;!s||n||c||u?t().catch(o.l2):l(s.data)},[e,a]),{data:t}})(x?e.hotelData?.id:void 0),y=(0,c.Q)();(0,i.uV)(()=>{y?.plainPhoneNumber&&y?.phoneNumber&&p(y)},[y]),(0,i.uV)(()=>{x?g&&x&&v(g):v(null)},[g,x]);let C={...e,salesContact:l||e.salesContact,calendarAvailability:b};return(0,a.jsx)(m.Provider,{value:C,children:e.children})},x=()=>{let e=p();return e?e.calendarAvailability:null}}}]);